2 * Adium is the legal property of its developers, whose names are listed in the copyright file included
3 * with this source distribution.
5 * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
6 * General Public License as published by the Free Software Foundation; either version 2 of the License,
7 * or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
10 * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
11 * Public License for more details.
13 * You should have received a copy of the GNU General Public License along with this program; if not,
14 * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 #import <Adium/AIWindowController.h>
18 #import <Adium/AIListObject.h>
19 #import <Adium/AIListContact.h>
20 #import <AIUtilities/AISmoothTooltipTracker.h>
22 @
class AIAutoScrollView
, AIListOutlineView
, AIListContactCell
, AIListGroupCell
, ESObjectWithStatus
, AIListObject
, AIChat
;
24 #define LIST_LAYOUT_FOLDER @"Contact List"
25 #define LIST_LAYOUT_EXTENSION @"ListLayout"
26 #define PREF_GROUP_LIST_LAYOUT @"List Layout"
28 #define KEY_LIST_LAYOUT_ALIGNMENT @"Contact Text Alignment"
29 #define KEY_LIST_LAYOUT_GROUP_ALIGNMENT @"Group Text Alignment"
30 #define KEY_LIST_LAYOUT_SHOW_ICON @"Show User Icon"
31 #define KEY_LIST_LAYOUT_USER_ICON_SIZE @"User Icon Size"
32 #define KEY_LIST_LAYOUT_SHOW_EXT_STATUS @"Show Extended Status"
33 #define KEY_LIST_LAYOUT_SHOW_STATUS_ICONS @"Show Status Icons"
34 #define KEY_LIST_LAYOUT_SHOW_SERVICE_ICONS @"Show Service Icons"
35 #define KEY_LIST_LAYOUT_WINDOW_STYLE @"Window Style"
37 #define KEY_LIST_LAYOUT_EXTENDED_STATUS_STYLE @"Extended Status Style"
38 #define KEY_LIST_LAYOUT_EXTENDED_STATUS_POSITION @"Extended Status Position"
39 #define KEY_LIST_LAYOUT_USER_ICON_POSITION @"User Icon Position"
40 #define KEY_LIST_LAYOUT_STATUS_ICON_POSITION @"Status Icon Position"
41 #define KEY_LIST_LAYOUT_SERVICE_ICON_POSITION @"Service Icon Position"
43 #define KEY_LIST_LAYOUT_CONTACT_SPACING @"Contact Spacing"
44 #define KEY_LIST_LAYOUT_GROUP_TOP_SPACING @"Group Top Spacing"
46 #define KEY_LIST_LAYOUT_VERTICAL_AUTOSIZE @"Vertical Autosizing"
47 #define KEY_LIST_LAYOUT_HORIZONTAL_AUTOSIZE @"Horizontal Autosizing"
48 #define KEY_LIST_LAYOUT_HORIZONTAL_WIDTH @"Horizontal Width"
49 #define KEY_LIST_LAYOUT_WINDOW_OPACITY @"Window Opacity"
51 #define KEY_LIST_LAYOUT_CONTACT_FONT @"Contact Font"
52 #define KEY_LIST_LAYOUT_STATUS_FONT @"Status Font"
53 #define KEY_LIST_LAYOUT_GROUP_FONT @"Group Font"
55 #define KEY_LIST_LAYOUT_CONTACT_LEFT_INDENT @"Contact Left Indent"
56 #define KEY_LIST_LAYOUT_CONTACT_RIGHT_INDENT @"Contact Right Indent"
58 #define KEY_LIST_LAYOUT_OUTLINE_BUBBLE @"Outline Bubble"
59 #define KEY_LIST_LAYOUT_CONTACT_BUBBLE_GRADIENT @"Contact Bubble Draw With Gradient"
60 #define KEY_LIST_LAYOUT_GROUP_HIDE_BUBBLE @"Group Hide Bubble"
61 #define KEY_LIST_LAYOUT_OUTLINE_BUBBLE_WIDTH @"Outline Bubble Line Width"
64 AIContactListWindowStyleStandard
= 0,
65 AIContactListWindowStyleBorderless
,
66 AIContactListWindowStyleGroupBubbles
,
67 AIContactListWindowStyleContactBubbles
,
68 AIContactListWindowStyleContactBubbles_Fitted
69 } AIContactListWindowStyle
;
72 LIST_POSITION_NA
= -1,
73 LIST_POSITION_FAR_LEFT
,
76 LIST_POSITION_FAR_RIGHT
,
77 LIST_POSITION_BADGE_LEFT
,
78 LIST_POSITION_BADGE_RIGHT
,
82 EXTENDED_STATUS_POSITION_BESIDE_NAME
= 0,
83 EXTENDED_STATUS_POSITION_BELOW_NAME
84 } EXTENDED_STATUS_POSITION
;
90 } EXTENDED_STATUS_STYLE
;
92 //AIListThemeWindowController defines
93 #define LIST_THEME_FOLDER @"Contact List"
94 #define LIST_THEME_EXTENSION @"ListTheme"
95 #define PREF_GROUP_LIST_THEME @"List Theme"
97 // Contact List Colors Enabled
98 #define KEY_AWAY_ENABLED @"Away Enabled"
99 #define KEY_IDLE_ENABLED @"Idle Enabled"
100 #define KEY_TYPING_ENABLED @"Typing Enabled"
101 #define KEY_SIGNED_OFF_ENABLED @"Signed Off Enabled"
102 #define KEY_SIGNED_ON_ENABLED @"Signed On Enabled"
103 #define KEY_UNVIEWED_ENABLED @"Unviewed Content Enabled"
104 #define KEY_ONLINE_ENABLED @"Online Enabled"
105 #define KEY_IDLE_AWAY_ENABLED @"Idle And Away Enabled"
106 #define KEY_OFFLINE_ENABLED @"Offline Enabled"
107 #define KEY_MOBILE_ENABLED @"Mobile Enabled"
109 #define KEY_LABEL_AWAY_COLOR @"Away Label Color"
110 #define KEY_LABEL_IDLE_COLOR @"Idle Label Color"
111 #define KEY_LABEL_TYPING_COLOR @"Typing Label Color"
112 #define KEY_LABEL_SIGNED_OFF_COLOR @"Signed Off Label Color"
113 #define KEY_LABEL_SIGNED_ON_COLOR @"Signed On Label Color"
114 #define KEY_LABEL_UNVIEWED_COLOR @"Unviewed Content Label Color"
115 #define KEY_LABEL_ONLINE_COLOR @"Online Label Color"
116 #define KEY_LABEL_IDLE_AWAY_COLOR @"Idle And Away Label Color"
117 #define KEY_LABEL_OFFLINE_COLOR @"Offline Label Color"
118 #define KEY_LABEL_MOBILE_COLOR @"Mobile Label Color"
120 #define KEY_AWAY_COLOR @"Away Color"
121 #define KEY_IDLE_COLOR @"Idle Color"
122 #define KEY_TYPING_COLOR @"Typing Color"
123 #define KEY_SIGNED_OFF_COLOR @"Signed Off Color"
124 #define KEY_SIGNED_ON_COLOR @"Signed On Color"
125 #define KEY_UNVIEWED_COLOR @"Unviewed Content Color"
126 #define KEY_ONLINE_COLOR @"Online Color"
127 #define KEY_IDLE_AWAY_COLOR @"Idle And Away Color"
128 #define KEY_OFFLINE_COLOR @"Offline Color"
129 #define KEY_MOBILE_COLOR @"Mobile Color"
131 #define KEY_LIST_THEME_BACKGROUND_IMAGE_ENABLED @"Use Background Image"
132 #define KEY_LIST_THEME_BACKGROUND_IMAGE_PATH @"Background Image Path"
133 #define KEY_LIST_THEME_BACKGROUND_FADE @"Background Fade"
134 #define KEY_LIST_THEME_BACKGROUND_IMAGE_STYLE @"Background Image Style"
136 #define KEY_LIST_THEME_BACKGROUND_COLOR @"Background Color"
137 #define KEY_LIST_THEME_HIGHLIGHT_COLOR @"Highlight Color"
138 #define KEY_LIST_THEME_GRID_COLOR @"Grid Color"
140 #define KEY_LIST_THEME_GROUP_BACKGROUND @"Group Background"
141 #define KEY_LIST_THEME_GROUP_BACKGROUND_GRADIENT @"Group Background Gradient"
142 #define KEY_LIST_THEME_GROUP_TEXT_COLOR @"Group Text Color"
143 #define KEY_LIST_THEME_GROUP_TEXT_COLOR_INVERTED @"Group Inverted Text Color"
144 #define KEY_LIST_THEME_GROUP_SHADOW_COLOR @"Group Shadow Color"
145 #define KEY_LIST_THEME_GROUP_GRADIENT @"Group Gradient"
146 #define KEY_LIST_THEME_GROUP_SHADOW @"Group Shadow"
148 #define KEY_LIST_THEME_CONTACT_STATUS_COLOR @"Contact Status Text Color"
150 #define KEY_LIST_THEME_GRID_ENABLED @"Grid Enabled"
151 #define KEY_LIST_THEME_HIGHLIGHT_ENABLED @"Custom Highlight Enabled"
152 #define KEY_LIST_THEME_BACKGROUND_AS_STATUS @"Background As Status"
153 #define KEY_LIST_THEME_BACKGROUND_AS_EVENTS @"Background As Events"
155 #define KEY_LIST_THEME_FADE_OFFLINE_IMAGES @"Fade Offline Images"
157 @protocol AIListControllerDelegate
158 - (IBAction
)performDefaultActionOnSelectedObject
:(AIListObject
*)selectedObject sender
:(NSOutlineView
*)sender
;
161 @interface AIAbstractListController
: AIObject
<AISmoothTooltipTrackerDelegate
> {
162 AIAutoScrollView
*scrollView_contactList
;
163 AIListOutlineView
*contactListView
;
165 AISmoothTooltipTracker
*tooltipTracker
;
167 AIListContactCell
*contentCell
;
168 AIListGroupCell
*groupCell
;
170 AIListObject
<AIContainingObject
> *contactList
;
173 float backgroundOpacity
;
178 BOOL configuredViewsAndTooltips
;
183 BOOL showTooltipsInBackground
;
186 NSArray
* draggedContacts
;
187 NSString
* dragOperation
;
189 - (id
)initWithContactListView
:(AIListOutlineView
*)inContactListView inScrollView
:(AIAutoScrollView
*)inScrollView_contactList delegate
:(id
<AIListControllerDelegate
>)inDelegate
;
191 - (void)contactListWillBeRemovedFromWindow
;
192 - (void)contactListWasAddedBackToWindow
;
194 - (void)setContactListRoot
:(ESObjectWithStatus
<AIContainingObject
> *)newContactListRoot
;
195 - (ESObjectWithStatus
<AIContainingObject
> *)contactListRoot
;
197 - (void)setHideRoot
:(BOOL
)inHideRoot
;
200 - (void)setBackgroundOpacity
:(float)opacity
;
202 - (IBAction
)performDefaultActionOnSelectedItem
:(NSOutlineView
*)sender
;
204 - (void)updateLayoutFromPrefDict
:(NSDictionary
*)prefDict andThemeFromPrefDict
:(NSDictionary
*)themeDict
;
205 - (void)updateCellRelatedThemePreferencesFromDict
:(NSDictionary
*)prefDict
;
207 - (void)listObjectAttributesChanged
:(NSNotification
*)notification
;
208 - (void)contactListDesiredSizeChanged
;
209 - (void)updateTransparency
;
210 - (BOOL
)useAliasesInContactListAsRequested
;
211 - (BOOL
)shouldUseContactTextColors
;
212 - (BOOL
)useStatusMessageAsExtendedStatus
;
214 - (void)configureViewsAndTooltips
;
217 - (void)showTooltipAtPoint
:(NSPoint
)screenPoint
;
218 - (AIListObject
*)contactListItemAtScreenPoint
:(NSPoint
)screenPoint
;
221 - (void)setShowTooltips
:(BOOL
)inShowTooltips
;
222 - (void)setShowTooltipsInBackground
:(BOOL
)inShowTooltipsInBackground
;
223 - (void)setDraggedContacts
:(NSArray
*)contacts
;
224 - (NSArray
*)draggedContacts
;
225 - (void)pasteboard
:(NSPasteboard
*)sender provideDataForType
:(NSString
*)type
;
227 - (void)performDefaultActionOnFirstItem
;
230 - (void)setDragItems
:(NSNotification
*)notification
;